let home = new Vue({
            //在id=home的元素中执行
            el: "#home",
            //将分隔符变更[ ]，以防和django模板语言的{}产生冲突
            delimiters: ["[[", "]]"],
            data: {
                mottos: [],
            },
            //用户加载完后执行函数
            mounted: function () {
                this.fetchmotto();
            },
            methods: {
                fetchmotto() {
                    axios.get("/api/v1/motto").then(response => {
                        this.mottos = response.data.res_data;
                    }), err => {
                        console.log(err);
                    }
                }
            }
        });
        let article = new Vue({
            el: "#article",
            delimiters: ["[[", "]]"],
            data: {
                article_menus: [],
                article_lists: [],
                article_cate: 'recently_reading',
                api_domain:'/api/v1',
                loading_pic: '../static/images/loading.gif',
                is_loaded: false,
            },
            mounted: function () {
                this.fetchariticle_default();
            },
            methods: {
                fetchariticle_default() {
                    axios.get(`${this.api_domain}/article/`).then(response => {
                        if (!this.is_loaded) {
                            this.is_loaded = true;
                        }
                        this.article_menus = response.data.note_menu_data;
                        this.article_lists = response.data.note_article_data;
                        this.article_cate = 'recently-reading';
                    }), err => {
                        console.log(err);
                    }
                },
                switch_isLoaded_tag(){
                    this.is_loaded = !this.is_loaded;
                    //{#console.log(this.is_loaded);#}
                },
                fetcharticle_cate(menu_code){
                    axios.get(`${this.api_domain}/article_cate/`,{
                        params : {
                            category : menu_code,
                        }
                    }).then(response => {
                        this.is_loaded= true;
                        this.article_lists = response.data.note_article_data;
                        this.article_cate = menu_code;
                        //{#console.log(this.article_cate)#}
                    }),err =>{
                        console.log(err)
                    }
                }
            }
        });